#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    //先使用widegt来设置标题
    this->setWindowTitle("Widget set");
    //创建按钮
    QPushButton* button=new QPushButton(this);
    button->setText("button");
    //再使用按钮来设置标题
    button->setWindowTitle("button set");
}

Widget::~Widget()
{
    delete ui;
}

